Layer -2 network extension over layer-3 network using layer-2 metadata

ABSTRACT

Techniques are disclosed for session-based routing within Open Systems Interconnection (OSI) Model Layer-2 (L2) networks extended over Layer-3 (L3) networks. In one example, L2 networks connect a first client device to a first router and a second client device to a second router. An L3 network connects the first and second routers. The first router receives, from the first client device, an L2 frame destined for the second client device. The first router generates an L3 packet comprising an L3 header specifying L3 addresses of the first and second routers, a first portion of metadata comprising L2 addresses for the first and second client devices, and a second portion of metadata comprising L3 addresses for the first and second client devices, and forwards the L3 packet to the second router. The second router recovers the L2 frame from the metadata and forwards the L2 frame to the second client device.

This application claims the benefit of U.S. Provisional Application No. 63/043,416, filed on Jun. 24, 2020, U.S. Provisional Application No. 63/043,426, filed on Jun. 24, 2020, and U.S. Provisional Application No. 63/043,423, filed on Jun. 24, 2020, the entire content of each of which is incorporated herein by reference.

TECHNICAL FIELD

This disclosure generally relates to computer networks, and, more specifically, routing packets within computer networks.

BACKGROUND

A computer network is a collection of interconnected computing devices that can exchange data and share resources. Example computing devices include routers, switches, and other Layer 2 (L2) network devices that operate within Layer 2 of the Open Systems Interconnection (OSI) reference model, i.e., the data link layer, and Layer 3 (L3) network devices that operate within Layer 3 of the OSI reference model, i.e., the network layer. Network devices within computer networks often include a control unit that provides control plane functionality for the network device and forwarding components for routing or switching data units.

The computing devices may establish a “network session” (also referred to herein as “session”) to enable communication between devices on a computer network. A session may be bidirectional in that the session includes packets traveling in both directions between a first device and a second device. For example, a session includes a forward packet flow originating from a first device and destinated for a second device and a reverse packet flow originating from the second device and destined for the first device. The forward and reverse packet flows of the session are related to one another in that the source address and source port of the forward packet flow is the same as the destination address and destination port of the reverse packet flow, and the destination address and destination port of the forward packet flow is the same as the source address and source port of the reverse packet flow. To establish a session, computing devices may use one or more communication session protocols including Transmission Control Protocol (TCP), Transport Layer Security (TLS), User Datagram Protocol (UDP), Internet Control Message Protocol (ICMP), etc.

SUMMARY

In general, the disclosure describes techniques for performing session-based routing over L2 networks extended over Layer-3 networks. In one example, a first L2 network connects a first client device to a first router, a second L2 network connects a second client device to a second router, and an L3 network connects the first router of the first L2 network to the second router of the second L2 network. The first router and second router may provide session-based routing. For example, the first router receives, from the first client device, an L2 frame destined for the second client device. The L2 frame includes an L2 header and a payload, where the L2 header specifies a source Media Access Control (MAC) address of the first client device and a destination MAC address of the second client device. Typically, routers of L2 networks use tunneling protocols, e.g., Generic Routing Encapsulation (GRE) or other IP tunneling, to transport L2 frames between L2 networks over an L3 network. Rather than tunneling the L2 frame, which encapsulates an L2/L3 packet inside another IP packet for transport across the IP network, the techniques describe generating, by the first router, an L3 packet comprising a first portion of metadata comprising L2 address information for the first and second client devices and a second portion of metadata comprising L3 address information for the first and second client devices, and sending the L3 packet to the second router such that the second router may generate, from the first portion of metadata comprising the L2 address information, the L2 frame comprising the L2 header and the payload, and forward, via the second L2 network, the recovered L2 frame to the second client device.

In one example, in response to receiving the L2 frame, the first router generates an L3 packet comprising an L3 header, a first portion of metadata comprising L2 address information for the first and second client devices, a second portion of metadata comprising L3 address information for the first and second client devices, and the payload. The L3 header specifies a source Internet Protocol (IP) address and a source port of the first router and a destination IP address and a destination port of the second router. The first portion of metadata comprises the source MAC address of the first client device and the destination MAC address of the second client device obtained from the L2 frame. The second portion of metadata comprises a source IP address and a source port of the first client device that correspond to the source MAC address of the first client device and a destination IP address and a destination port of the second client device that correspond to the destination MAC address of the second client device. The first router forwards, via the L3 network, and to the second router, the L3 packet including the first portion of metadata and the second portion of metadata. The second router receives the L3 packet and generates, from the first portion of metadata, the L2 frame comprising the L2 header and the payload. The second router forwards, via the second L2 network, the recovered L2 frame to the second client device.

In some examples, the first router uses the second portion of metadata as a session identifier to identify a session for the L3 packet, the session comprising a forward flow originating from the first client device and destined for the second client device and a reverse flow originating from the second client device and destined for the first client device. The first router may use this session identifier to perform session-based routing of the L3 packet across the L3 network.

The techniques of the disclosure may provide specific improvements to the computer-related field of computer networking that have practical applications. For example, the techniques disclosed herein may enable the extension of an L2 network across an L3 network without the use of tunnels or packet encapsulation. For example, the use of metadata to specify L2 address information obviates the need to use tunnels, such as GRE or other tunneling protocols, to encapsulate an L2/L3 packet inside another IP packet for transport across the IP network. Therefore, by eliminating the overhead associated with the use of tunnels and/or encapsulation, the techniques of the disclosure may substantially reduce network congestion and resource consumption of L2 networks extended across L3 networks, as well as improving network latency and bandwidth in such networks. Furthermore, the techniques disclosed herein may enable the application of L3 traffic engineering, and in particular, session-based routing techniques, to L2 traffic. Therefore, such techniques as described herein may provide greater efficiency and scalability to L2 networks extended across L3 networks.

In one example, this disclosure describes a method comprising: receiving, by a first router and from a first client device connected to the first router via a first Open Systems Interconnection (OSI) Model Layer-2 (L2) network, an L2 frame destined for a second client device, the L2 frame comprising an L2 header specifying a source Media Access Control (MAC) address of the first client device and a destination MAC address of the second client device, wherein the first router is connected to a second router via an OSI Model Layer-3 (L3) network, and wherein the second router is connected to the second client device via a second L2 network; generating, by the first router and in response to receiving the L2 frame, an L3 packet comprising: an L3 header specifying a source Internet Protocol (IP) address and a source port of the first router and a destination IP address and a destination port of the second router; a first portion of metadata comprising the source MAC address of the first client device and the destination MAC address of the second client device; and a second portion of metadata comprising: a source IP address and a source port of the first client device that correspond to the source MAC address of the first client device; and a destination IP address and a destination port of the second client device that correspond to the destination MAC address of the second client device; and forwarding, by the first router, via the L3 network, and to the second router, the L3 packet.

In another example, this disclosure describes a first router comprising processing circuitry configured to: receive, from a first client device connected to the first router via a first Open Systems Interconnection (OSI) Model Layer-2 (L2) network, an L2 frame destined for a second client device, the L2 frame comprising an L2 header specifying a source Media Access Control (MAC) address of the first client device and a destination MAC address of the second client device, wherein the first router is connected to a second router via an OSI Model Layer-3 (L3) network, and wherein the second router is connected to the second client device via a second L2 network; generate, in response to receiving the L2 frame, an L3 packet comprising: an L3 header specifying a source Internet Protocol (IP) address and a source port of the first router and a destination IP address and a destination port of the second router; a first portion of metadata comprising the source MAC address of the first client device and the destination MAC address of the second client device; and a second portion of metadata comprising: a source IP address and a source port of the first client device that correspond to the source MAC address of the first client device; and a destination IP address and a destination port of the second client device that correspond to the destination MAC address of the second client device; and forward, via the L3 network, and to the second router, the L3 packet.

In another example, this disclosure describes a method comprising: receiving, by a second router and from a first router connected to the second router via an Open Systems Interconnection (OSI) Model Layer-3 (L3) network, an L3 packet, wherein the first router is connected to a first client device via a first OSI Model Layer-2 (L2) network and the second router is connected to a second client device via a second L2 network, and wherein the L3 packet comprises: an L3 header specifying a source Internet Protocol (IP) address and a source port of the first router and a destination IP address and a destination port of the second router; a first portion of metadata comprising a source Media Access Control (MAC) address of the first client device and a destination MAC address of the second client device; and a second portion of metadata comprising: a source IP address and a source port of the first client device that correspond to the source MAC address of the first client device; and a destination IP address and a destination port of the second client device that correspond to the destination MAC address of the second client device; generating, by the second router and based on the first portion of metadata of the L3 packet, an L2 frame comprising an L2 header specifying the source MAC address of the first client device and the destination MAC address of the second client device; and forwarding, by the second router, via the second L2 network, and to the second client device, the L2 frame.

The details of one or more examples of the techniques of this disclosure are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the techniques will be apparent from the description and drawings, and from the claims.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating an example computer network system in accordance with the techniques of the disclosure.

FIG. 2 is a block diagram illustrating an example router in accordance with the techniques of the disclosure.

FIGS. 3A-3B are block diagrams illustrating a data structure for an L2 frame and a data structure for an L3 packet generated from the L2 frame in accordance with the techniques of the disclosure.

FIG. 4 is a flowchart illustrating an example operation in accordance with the techniques of the disclosure.

Like reference characters refer to like elements throughout the figures and description.

DETAILED DESCRIPTION

FIG. 1 is a block diagram illustrating an example computer network system 2 in accordance with the techniques of the disclosure. In the example of FIG. 1, computer network system 2 includes service provider networks 150A-150D (collectively, “service provider networks 150”) configured to provide Wide Area Network (WAN) connectivity to disparate customer networks 140A-140B (collectively, “customer networks 140”). Routers 110A-110I (collectively, “routers 110”) of service provider networks 150 provide client devices 100A-100B (collectively, “client devices 100”) associated with customer networks 140 with access to service provider networks 150. In some examples, customer networks 140 are enterprise networks. Customer network 140A is depicted as having a single client device 100A and customer network 140B is depicted as having a single client device 100B for ease of illustration, but each of customer networks 140 may include any number of client devices.

As depicted in the example of FIG. 1, customer networks 140 are L2 computer networks, where reference to a layer followed by a number refers to a corresponding layer in the Open Systems Interconnection (OSI) model. L2 is also known as a “data link layer” in the OSI model and the term L2 may be used interchangeably with the phrase “data link layer” throughout this disclosure. Typically, customer networks 140 include many client devices 100, each of which may communicate across service provider networks 150 with one another as described in more detail below. Communication links 16A-16G (collectively, links “16”) may be Ethernet, ATM or any other suitable network connections.

Routers 110 are illustrated as routers in the example of FIG. 1. However, techniques of the disclosure may be implemented using any network device, such as switches, routers, gateways, or other suitable network devices that may send and receive network traffic. Customer networks 140 may be networks for geographically separated sites of an enterprise, for example. Each of customer networks 140 may include additional customer equipment, such as, one or more non-edge switches, routers, hubs, gateways, security devices such as firewalls, intrusion detection, and/or intrusion prevention devices, servers, computer terminals, laptops, printers, databases, wireless mobile devices such as cellular phones or personal digital assistants, wireless access points, bridges, cable modems, application accelerators, or other routers not depicted in FIG. 1. The configuration of computer network system 2 illustrated in FIG. 1 is merely an example. For example, computer network system 2 may include any number of customer networks 140. Nonetheless, for ease of description, only customer networks 140A-140B are illustrated in FIG. 1.

Service provider networks 150 represent one or more publicly accessible computer networks that are owned and operated by one or more service providers. Although computer network system 2 is illustrated in the example of FIG. 1 as including multiple interconnected service provider networks 150, in other examples computer network system 2 may alternatively include a single service provider network that provides connectivity between customer networks 140. A service provider is usually a large telecommunications entity or corporation. Each of service provider networks 150 is usually a large L3 computer network. Each service provider network 150 is an L3 network in the sense that it natively supports L3 operations as described in the OSI model. Common L3 operations include those performed in accordance with L3 protocols, such as the Internet Protocol (IP). L3 is also known as a “network layer” in the OSI model and the term L3 may be used interchangeably with the phrase “network layer” throughout this disclosure.

Although not illustrated, each service provider network 150 may be coupled to one or more networks administered by other providers, and may thus form part of a large-scale public network infrastructure, e.g., the Internet. Consequently, customer networks 140 may be viewed as edge networks of the Internet. Each service provider network 150 may provide computing devices within customer networks 140, such as client devices 100, with access to the Internet, and may allow the computing devices within customer networks 140 to communicate with each other.

Although additional routers are not shown for ease of explanation, it should be understood that system 2 may comprise additional network and/or computing devices such as, for example, one or more additional switches, routers, hubs, gateways, security devices such as firewalls, intrusion detection, and/or intrusion prevention devices, servers, computer terminals, laptops, printers, databases, wireless mobile devices such as cellular phones or personal digital assistants, wireless access points, bridges, cable modems, application accelerators, or other routers. Moreover, although the elements of system 2 are illustrated as being directly coupled, it should be understood that one or more additional network elements may be included along any of network links 16, such that the network elements of system 2 are not directly coupled.

Each service provider network 150 typically provides a number of residential and business services for customer networks 140, including residential and business class data services (which are often referred to as “Internet services” in that these data services permit access to the collection of publicly accessible networks referred to as the Internet), residential and business class telephone and/or voice services, and residential and business class television services.

Session-Based Routing

In some examples, routers 110 may implement a stateful, session-based routing scheme that enables each router 110 to independently perform path selection and traffic engineering. The use of session-based routing may enable routers 110 to eschew the use of a centralized controller, such as a Software-Defined Networking (SDN) controller to perform path selection and traffic engineering. In this way, routers 110 may be more efficient and scalable for large networks where the use of an SDN controller would be infeasible. Furthermore, the use of session-based routing may enable routers 110 to eschew the use of tunnels, thereby saving considerable network resources by obviating the need to perform encapsulation and decapsulation at tunnel endpoints. In some examples, routers 110 implement session-based routing as Secure Vector Routing (SVR), provided by Juniper Networks, Inc.

In the example of FIG. 1, client device 100A of system 2 establishes session 40 with client device 100B. Routers 110 facilitate establishment of session 40 by transporting network traffic between client device 100A and client device 100B. In some examples, client device 100A may be considered a “source” device in that client device 100A originates session 40 between client device 100A and client device 100B, e.g., client device 100A is the “source” of a packet of a forward flow of the session. Session 40 includes a forward packet flow originating from client device 100A and destined for client device 100B and a reverse packet flow originating from client device 100B and destined for client device 100A. A forward flow for session 40 traverses a first path including, e.g., client device 100A, routers 110A-110I, and client device 100B. As described in more detail below, routers 110 enable the extension of customer network 140A, an L2 network, across service provider networks 150, e.g., L3 networks, to customer network 140B, another L2 network.

Client device 100A may establish session 40 with client device 100B according to one or more L2 communication session protocols, including Ethernet. As described in more detail below, customer network 140A may form a first L2 network and customer network 140B may form a second L2 network. Routers 110 operate to extend customer network 140A across service provider networks 150, which are one or more L3 networks, to customer network 140B. In this fashion, customer network 140A and customer network 140B may operate as if they were both part of the same L2 network, even though customer network 140A and customer network 140B may be logically isolated and geographically separate from one another. Furthermore, routers 110 may operate such that the existence of service provider networks 150 between customer network 140A and customer network 140B is transparent to client devices 100.

In some examples, routers 110 may extend session 40 as an L3 session across service provider networks 150 according to one or more L3 communication session protocols, including TCP or UDP, etc. For example, to establish session 40 according to TCP such that data may be exchanged according to TCP, router 110A and router 110B perform a three-way handshake. Router 110A sends a first packet comprising a “SYN” flag to router 110B. Router 110B acknowledges receipt of the first packet by responding to router 110A with a second packet comprising a “SYN-ACK” flag. Router 110A acknowledges receipt of the second packet by responding to router 110B with a third packet comprising an “ACK” flag. After sending the third packet, session 40 is established according to TCP and routers 110A, 110B may exchange data with one another (e.g., by transporting L2 data between client device 100A and client device 100B) via session 40. Additional example information regarding TCP is described in “TRANSMISSION CONTROL PROTOCOL,” Request for Comments (RFC) 793, Internet Engineering Task Force (IETF), September 1981, available at https://tools.ietf.org/html/rfc793, the entire contents of which are incorporated herein by reference.

UDP is a connectionless protocol in that router 110A does not verify that router 110B is capable of receiving data prior to transmitting data. To establish session 40 according to UDP, router 110A transmits a first packet to router 110B. Session 40 may be considered “established” according to UDP upon receipt by router 110A of any packet from router 110B, which implies that router 110B successfully received the first packet from router 110A, responded, and router 110A was able to receive the response from router 110B. Additional example information regarding UDP is described in “User Datagram Protocol,” RFC 768, IETF, Aug. 28, 1980, available at https://tools.ietf.org/html/rfc768, the entire contents of which are incorporated herein by reference.

In the example of FIG. 1, when router 110A receives a packet for the forward packet flow originating from client device 100A and destined for client device 100B, router 110A determines whether the packet belongs to a new session (e.g., is the “first” packet or “lead” packet of session 40). In some examples, router 110A determines whether a source address, source port, destination address, destination port, and protocol of the first packet matches an entry in a session table.

If no such entry exists, router 110A determines that the packet belongs to a new session and creates an entry in the session table. Furthermore, if the packet belongs to a new session, router 110A may generate a session identifier for session 40. The session identifier may comprise, e.g., a source address and source port of client device 100A, a destination address and destination port of client device 100B, and a protocol used by the first packet. Router 110A may use the session identifier to identify subsequent packets as belonging to the same session.

In some examples, routers 110 perform stateful routing for session 40. For example, routers 110 may forward each packet of the forward packet flow of session 40 sequentially and along the same forward network path. As described herein, the “same” forward path may mean the same routers 110 that form a segment or at least a portion between a device originating the packet and a device to which the packet is destined (and not necessarily the entire network path between the device originating the packet and the device to which the packet is destined). Further, routers 110 forward each packet of the return flow of session 40 sequentially and along the same return network path. The forward network path for the forward packet flow of session 40 and the return network path of the return packet flow of session 40 may be the same path, or different paths. By ensuring that each packet of a flow is forwarded sequentially and along the same path, routers 110 maintain the state of the entire flow at each router 110, thereby enabling the use of stateful packet services, such as Deep Packet Inspection (DPI).

In the example of FIG. 1, a stateful routing session may be established from ingress router 110A through intermediate routers 110B-110H to egress router 110I. In this example, router 110A determines that the first packet is an unmodified packet and the first packet of new session 40. Router 110A modifies the first packet to include metadata specifying the session identifier (e.g., the original source address, source port, destination address, and destination port). Router 110A replaces the header of the modified first packet to specify a source address that is an address of router 110A, a source port that is a port via which router 110A forwards the modified first packet toward client device 100B, a destination address that is an address of the next hop to which router 110A forwards the first packet (e.g., an address of router 110B), and a destination port that is a port of the next hop to which router 110A forwards the first packet (e.g., a port of router 110B).

Router 110A may further identify a network service associated with session 40. For example, router 110A may compare one or more of a source address, source port, destination address, or destination port for the session to a table of service address and port information to identify a service associated with the session. Examples of network services include Hypertext Transfer Protocol (HTTP), a firewall service, a proxy service, packet monitoring or metrics services, etc. For example, router 110A may determine that the forward packet flow of session 40 specifies a destination address and destination port assigned to client device 100B. Router 110A may thereafter store an association between session 40 with the identified network service. As another example, if the source port and/or destination port for session 40 is 80, router 110A may determine that session 40 is associated with an HTTP service. In other examples, router 110A may determine that one or more of a source address, source port, destination address, or destination port for session 40 belong to a block of address or ports indicative that a particular service is associated with session 40.

In some examples, router 110A uses the determined network service for session 40 to select a forward path for forwarding the first packet and each subsequent packet of the forward packet flow of session 40 toward client device 100B. In this fashion, router 110A may perform service-specific path selection to select a network path that best suits the requirements of the service. In contrast to a network topology that uses an SDN controller to perform path selection, each router 110 performs path selection. Further, the use of session-based routing enables each router 110 to make routing decisions at the service- or application-level, in contrast to conventional routers that are only able to make routing decisions at the flow level.

Router 110A forwards the modified first packet to router 110B. Additionally, router 110A stores the session identifier for session 40 such that, upon receiving subsequent packets for session 40, router 110A may identify the subsequent packets as belonging to the same session 40 and forward the subsequent packets along the same path as the first packet.

Intermediate router 110B receives the modified first packet and determines whether the modified first packet includes metadata specifying the session identifier. In response to determining that the modified first packet includes metadata specifying the session identifier, intermediate router 110B determines that router 110B is not an ingress device such that router 110B does not attach metadata specifying the session identifier.

As described above with respect to router 110A, router 110B determines whether the packet belongs to a new session (e.g., is the “first” packet or “lead” packet of the session) by determining whether a source address, source port, destination address, destination port, and protocol of the first packet matches an entry in a session table. If no such entry exists, router 110B determines that the packet belongs to a new session and creates an entry in the session table. Furthermore, if the packet belongs to a new session, router 110B generates a session identifier for the session. The session identifier used by router 110B to identify the session for the first packet may be different from the session identifier used by router 110A to identify the same session for the first packet, because each router 110A, 110B uses the header source address, source port, destination address, and destination port of the first packet to generate the session identifier, and this header information may be modified by each preceding router 110 as each router 110 forwards the first packet along the forward path. Furthermore, each router 110 may store this header information to identify a previous router 110 (or “waypoint”) and a next router 110 (or “waypoint”) such that each router 110 may reconstruct the same forward path and reverse path for each subsequent packet of the session.

Router 110B replaces the header of the modified first packet to specify a source address that is an address of router 110B, a source port that is a port via which router 110B forwards the modified first packet toward client device 100B, a destination address that is an address of the next hop to which router 110B forwards the first packet (e.g., an address of router 110C for session 40 along the first path), and a destination port that is a port of the next hop to which router 110B forwards the first packet (e.g., a port of router 110C). Router 110B forwards the modified first packet to router 110C. Additionally, router 110B stores the session identifier for the session such that, upon receiving subsequent packets for the session, router 110B may identify subsequent packets as belonging to the same session and forward the subsequent packets along the same path as the first packet.

Subsequent intermediate routers 110C-110H process the modified first packet in a similar fashion as routers 110A and 110B such that routers 110 forward the subsequent packets of the session along the same path as the first packet. Further, each router 110 stores a session identifier for the session, which may include an identification of the previous router 110 along the network path. Thus, each router 110 may use the session identifier to forward packets of the reverse packet flow for the session along the same network path back to client device 100.

A router 110 that may forward packets for a forward packet flow of the session to a destination for the packet flow is an egress, or “terminus” router. In the foregoing example, router 110I is a terminus router because router 110I may forward packets to client device 100B. Router 110I receives the modified first packet that comprises the metadata specifying the session identifier (e.g., the original source address, source port, destination address, and destination port). Router 110I identifies the modified first packet as destined for a service terminating at router 110I by determining that the destination source address and destination source port specified in the metadata of the modified lead packet corresponds to a destination reachable by router 110I (e.g., client device 100B). Router 110I recovers the original first packet by removing the metadata from the modified first packet and using the metadata to modify the header of the first packet to specify the original source address, source port, destination address, and destination port. Router 110I forwards the recovered first packet to client device 100B. The use of session-based routing may therefore form a series of waypoints (e.g., routers 110) interconnected by path “segments” (e.g., end-to-end route vectors between each waypoint).

Additional information with respect to session-based routing and SVR is described in U.S. Pat. No. 9,729,439, entitled “COMPUTER NETWORK PACKET FLOW CONTROLLER,” and issued on Aug. 8, 2017; U.S. Pat. No. 9,729,682, entitled “NETWORK DEVICE AND METHOD FOR PROCESSING A SESSION USING A PACKET SIGNATURE,” and issued on Aug. 8, 2017; U.S. Pat. No. 9,762,485, entitled “NETWORK PACKET FLOW CONTROLLER WITH EXTENDED SESSION MANAGEMENT,” and issued on Sep. 12, 2017; U.S. Pat. No. 9,871,748, entitled “ROUTER WITH OPTIMIZED STATISTICAL FUNCTIONALITY,” and issued on Jan. 16, 2018; U.S. Pat. No. 9,985,883, entitled “NAME-BASED ROUTING SYSTEM AND METHOD,” and issued on May 29, 2018; U.S. Pat. No. 10,200,264, entitled “LINK STATUS MONITORING BASED ON PACKET LOSS DETECTION,” and issued on Feb. 5, 2019; U.S. Pat. No. 10,277,506, entitled “STATEFUL LOAD BALANCING IN A STATELESS NETWORK,” and issued on Apr. 30, 2019; U.S. Pat. No. 10,432,522, entitled “NETWORK PACKET FLOW CONTROLLER WITH EXTENDED SESSION MANAGEMENT,” and issued on Oct. 1, 2019; and U.S. Patent Application Publication No. 2020/0403890, entitled “IN-LINE PERFORMANCE MONITORING,” published on Dec. 24, 2020, the entire content of each of which is incorporated herein by reference in its entirety.

Exchanging Service and Topology State Information

In some examples, to implement session-based routing, each router 110 maintains a local repository of service and topology state information for each other router 110. The service and topology state information includes services reachable from each router 110, as well as a network topology from each router for reaching these services. Each router 110 may transmit changes in the services reachable from the router 110 and/or changes in the network topology for reaching the services from the router to a central repository, e.g., a server. Further, each router 110 may receive service and topology state information for each other router 110 in system 2 from the central repository.

In the foregoing example, router 110A receives a packet, determines session 40 for the forward packet flow comprising the packet, determines a service associated with session 40, and selects a network path for forwarding the packet. Router 110A may use its local copy of the service and topology state information for each router 110 to select the network path for forwarding the packet. For example, router 110A may use the identified service associated with the packet and a network topology for reaching the identified service to select a network path that comports with an SLA requirement or other session performance requirements for the service. Router 110A may then forward the packet and subsequent packets for the forward packet flow of session 40 along the selected path. In this fashion, router 110A may perform service-specific path selection in that router 110 may use criteria specific to the service associated with the packet to select a network path that best suits the requirements of the service.

In some examples, interfaces of routers 110 may be assigned to one or more “neighborhoods.” A “neighborhood” is defined as a label applied to an interface of a router 110. The routers 110 within the same neighborhood are capable of forming a peering relationship with one another. For example, each router 110 having an interface to which a neighborhood label is applied is reachable over a Layer-3 network to each other router 110 having an interface to which the same neighborhood label is applied. In some examples, one or more neighborhoods may be aggregated into a “district.” A district is a logical grouping of one or more neighborhoods. Typically, an Autonomous System (AS) (also referred to herein as an “Authority”) may be divided into one or more districts, each district including one or more neighborhoods.

In some examples, each router 110 maintains a local repository of service and topology state information only for those other routers 110 within the same neighborhood. In some examples, each router 110 maintains a local repository of service and topology state information only for those other routers 110 within the same district of neighborhoods. As an example, each service provider network 150 may be considered to be a different “district,” wherein each subdomain within each service provider network 150 may be considered to be a neighborhood within that district. In this example, each router 110A and 110B within service provider network 150A may maintain service and topology state information only for one another, and not for routers 110C-110I. Similarly, each router 110D and 110C within service provider network 150B may maintain service and topology state information only for one another, and not for routers 110A-110B or 110E-110I. In other examples, an administrator may assign one or more service provider networks 150 into one or more districts, one or more neighborhoods, or a combination of districts and neighborhoods as suits the needs of network system 2.

Additional information with respect to the exchange of service and topology state information is described in U.S. Patent Application Publication No. 2020/0366590, entitled “CENTRAL AUTHORITY FOR SERVICE AND TOPOLOGY EXCHANGE,” published on Nov. 19, 2020; U.S. Patent Application Publication No. 2020/0366599, entitled “SOURCE-BASED ROUTING,” published on Nov. 19, 2020; U.S. Patent Application Publication No. 2020/0366598, entitled “SERVICE AND TOPOLOGY EXCHANGE PROTOCOL,” published on Nov. 19, 2020; U.S. Patent Application Publication No. 2020/0366589, entitled “ROUTING USING SEGMENT-BASED METRICS,” published on Nov. 19, 2020; and U.S. patent application Ser. No. 16/050,722, entitled “NETWORK NEIGHBORHOODS FOR ESTABLISHING COMMUNICATION RELATIONSHIPS BETWEEN COMMUNICATION INTERFACES IN AN ADMINISTRATIVE DOMAIN,” filed on Jul. 31, 2018, the entire content of each of which is incorporated herein by reference in its entirety.

Layer-2 Network Extension Over Layer-3 Network Using Metadata

In accordance with the techniques of the disclosure, computer network system 2 performs session-based routing over L2 customer networks 140 extended over L3 service provider networks 150. In one example, L2 customer network 140A connects client device 100A to router 110A, L2 customer network 140B connects client device 100B to router 110I, and L3 service provider networks 150 connect router 110A to router 110I via routers 110B-110H. Router 110A receives, from client device 100A, an L2 frame destined for client device 110B. The L2 frame includes an L2 header and a payload. The L2 header specifies a source Media Access Control (MAC) address of client device 100A and a destination MAC address of client device 100B.

In some examples, the payload of the L2 frame may comprise a higher-level packet, such as an encapsulated L3 packet. For example, the L2 frame payload may comprise a session-based packet, such as an L3 packet such as a TCP/IP packet a UDP/IP packet, etc. As another example, the L2 frame payload may comprise a non-session-based packet, such as an Address Resolution Protocol (ARP) request, a Cisco Discovery Protocol (CDP) request, or a Link Layer Discovery Protocol (LLDP) request, etc. As another example, the L2 frame may comprise a VxLAN L2 frame with a payload comprising a non-IP packet. As another example, the L2 frame may comprise a VxLAN L2 frame with a payload comprising an IP packet.

In a conventional L3 extension of an L2 network, a first router receives an L2 frame from an originating device, encapsulates the L2 frame with an L3 packet, and forwards the L3 packet across an L3 network to a second router. To recover the L2 frame, the second router decapsulates the L3 packet and forwards the recovered L2 frame to a destination device. However, the encapsulated L3 packet is necessarily a larger size than the L2 frame, thereby increasing the size of the transmitted data and consuming additional network bandwidth. Further, the encapsulation and decapsulation operations performed by each router cause additional computational overhead, reducing the throughput and scalability of each router. To eliminate the need for the use of tunnels and/or encapsulation and reduce the resource consumption of routers 110, routers 110 perform session-based routing.

However, conventionally, when a router receives an unencapsulated L3 packet, the router performs an L2 address translation of an L3 destination IP address and port specified by an L3 header of the L3 packet to obtain an L2 destination address. The router may then generate an L2 frame comprising the L2 destination address for forwarding the data carried by the L3 packet to the destination device. However, the L2 address translation assumes that the L3 header of the L3 packet specifies an L3 destination address that corresponds to an L2 address of the client device.

As described above, when performing session-based routing, each router 110 replaces an L3 header of a received L3 packet with a source IP address and a source port of the current router 110 and a destination IP address and a destination port of the next-hop router 110. For example, router 110B may replace the L3 header of the L3 packet with a new L3 header that specifies a source IP address and a source port of router 110B and a destination IP address and destination port of router 110C before forwarding the L3 packet to router 110C. Router 110C, in turn, may replace the L3 header of the L3 packet with yet another new L3 header that specifies a source IP address and a source port of router 110C and a destination IP address and destination port of router 110D before forwarding the L3 packet to router 110D, and so on, until router 110I receives an L3 packet from router 110H comprising an L3 header specifying a source address and port of router 110H and a destination address and port of router 110I.

Thus, when using session-based routing, router 110I receives an L3 packet that comprising an L3 header specifying a source address and port of router 110H and a destination address and port of router 110I. If router 110I were to perform an L2 address translation of the destination address and port of router 110I, router 110I would obtain a MAC address of router 110I, in contrast to the intended destination of the L2 frame originated by client device 100A being the MAC address of client device 100B. Thus, conventionally, router 110I may be unable to recover the L2 address information needed to recover the L2 frame originated by client device 100A from an L3 packet comprising an L3 header specifying, e.g., the source IP address and source port of router 110H and the destination IP address and destination port of router 110I.

Furthermore, even where the L3 packet is modified for session-based routing as described above to include a session identifier (e.g., the second portion of metadata) that comprises a source IP address and a source port of client device 100A that correspond to the source MAC address of client device 100A and a destination IP address and a destination port of client device 100B that correspond to the destination MAC address of client device 100B, router 110I may still be unable to recover the L2 frame originated by client device because such a session identifier does not include L2 addressing information, e.g., the source MAC address of client device 100A and the destination MAC address of client device 100B. For example, an L2 address translation of the destination IP address and a destination port of client device 100B specified by the session identifier may not properly identify the destination MAC address of client device 100B in all circumstances, for example, where Network Address Translation (NAT) is used by one or both of client devices 100A and 100B.

Therefore, in accordance with the techniques of the disclosure, router 110A generates, in response to receiving the L2 frame, an L3 packet comprising an L3 header, a first portion of metadata comprising L2 address information for the first and second client devices, a second portion of metadata comprising L3 address information for the first and second client devices, and the payload. The L3 header specifies a source Internet Protocol (IP) address and a source port of router 110A and a destination IP address and a destination port of router 110B. The first portion of metadata may comprise the source MAC address of client device 100A and the destination MAC address of client device 100B obtained from the L2 frame. The second portion of metadata may comprise a source IP address and a source port of client device 100A that correspond to the source MAC address of client device 100A and a destination IP address and a destination port of client device 100B that correspond to the destination MAC address of client device 100B. Router 110A forwards, via L3 service provider network 150A, and to router 110B, the L3 packet including the first portion of metadata and second portion of metadata. Router 110B forwards the L3 packet to router 110C, which in turn forwards the L3 packet to router 110D, and so on, until the L3 packet reaches router 110I.

In accordance with the techniques of the disclosure, because router 110A generates the L3 packet to include the first portion of metadata comprising the source MAC address of client device 100A and the destination MAC address of client device 100B obtained from the L2 frame, router 110I may use the first portion of metadata to generate, from the L3 packet, the L2 frame comprising the L2 header and the payload. Router 110I may thereafter forward, via L2 customer network 140B, the recovered L2 frame to client device 100B.

In some examples, router 110A uses the second portion of metadata as a session identifier to identify a session for the L3 packet, the session comprising a forward flow originating from client device 100A and destined for client device 100B and a reverse flow originating from client device 100B and destined for client device 100A. Router 110A may use this session identifier to perform session-based routing of the L3 packet across L3 service provider networks 150 and apply stateful routing services to the L3 packet as described above.

The techniques of the disclosure may enable the extension of an L2 network across an L3 network without the use of tunnels or packet encapsulation. For example, the use of the first portion of metadata to specify L2 address information obviates the need to use tunnels, such as GRE, to encapsulate an L2/L3 packet inside another IP packet for transport across an IP network. Therefore, by eliminating the overhead associated with the use of tunnels and/or encapsulation, the techniques of the disclosure may substantially reduce network congestion and resource consumption of L2 networks extended across L3 networks, as well as improve network latency and bandwidth in such networks. Furthermore, by eliminating the need to use tunnels or encapsulation to extend L2 networks across L3 networks, the techniques of the disclosure may obviate the need to use customer edge devices to translate L2 customer traffic within L2 networks into L3 traffic suitable for forwarding across an L3 service provider network. Furthermore, the techniques disclosed herein may enable the application of L3 traffic engineering, and in particular, session-based routing techniques, to L2 traffic. Therefore, such techniques as described herein may provide greater efficiency and scalability to L2 networks extended across L3 networks.

Furthermore, the techniques of the disclosure may provide additional advantages over conventional Multiprotocol Label Switching (MPLS) networks. For example, a system as described herein may eliminate the need for additional customer edge devices deployed to establish MPLS pseudowires. Additionally, a system as described herein that uses the first portion of metadata of an L3 packet to route VXLAN packets may eliminate the need to tunnel VXLAN packets within another IP packet, such as GRE, thereby reducing the resource overhead of the network and avoiding unnecessary fragmentation. Furthermore, the L3 packets described herein may be forwarded over the Internet or over MPLS networks, thereby allowing for multiple path redundancy without extensive modification of the underlying network structure or protocols. Additionally, the system as described herein enables the use of session-based routing for L2 networks extended over L3 networks, thereby enabling the increased security provided by session-based routing (e.g., by encrypting and authenticating each packet) within an L2 network.

In some examples, routers 110 may perform session-based routing of non-session-based L2 frames extended over Layer-3 networks using encapsulation. Additional information with respect to performing session-based routing of non-session-based L2 frames extended over Layer-3 networks using encapsulation is set forth in U.S. patent application No. ______, entitled “LAYER 2 EXTENSION OVER A LAYER 3 NETWORK USING ENCAPSULATION,” filed on ______, (Attorney Docket No. 2014-337US01), the entire content of which is incorporated herein by reference in its entirety.

In some examples, routers 110 may perform session-based routing of point-to-multipoint L2 frames extended over Layer-3 networks. Additional information with respect to performing session-based routing of point-to-multipoint L2 frames extended over Layer-3 networks is set forth in U.S. patent application Ser. No. ______, entitled “POINT-TO-MULTIPOINT LAYER 2 EXTENSION OVER A LAYER 3 NETWORK,” filed on ______, (Attorney Docket No. 2014-338US01), the entire content of which is incorporated herein by reference in its entirety.

FIG. 2 is a block diagram illustrating an example router 110 in accordance with the techniques of the disclosure. In general, router 110 may be an example of one of routers 110 of FIG. 1. In this example, router 110 includes interface cards 226A-226N (“IFCs 226”) that receive packets via incoming links 228A-228N (“incoming links 228”) and send packets via outbound links 230A-230N (“outbound links 230”). IFCs 226 are typically coupled to links 228, 230 via a number of interface ports. Router 110 also includes a control unit 202 that determines routes of received packets and forwards the packets accordingly via IFCs 226.

Control unit 202 may comprise routing engine 204 and packet forwarding engine 222. Routing engine 204 operates as the control plane for router 110 and includes an operating system that provides a multi-tasking operating environment for execution of a number of concurrent processes. Routing engine 204 communicates with other routers, e.g., such as routers 110 of FIG. 1, to establish and maintain a computer network, such as computer network system 2 of FIG. 1, for transporting network traffic between one or more customer devices. Routing protocol daemon (RPD) 208 of routing engine 204 executes software instructions to implement one or more control plane networking protocols 212. For example, protocols 212 may include one or more routing protocols, such as Internet Group Management Protocol (IGMP) 221 and/or Border Gateway Protocol (BGP) 220, for exchanging routing information with other routing devices and for updating routing information base (RIB) 206, Multiprotocol Label Switching (MPLS) protocol 214, and other routing protocols. Protocols 212 may further include one or more communication session protocols, such as TCP, UDP, TLS, or ICMP.

RIB 206 may describe a topology of the computer network in which router 110 resides, and may also include routes through the shared trees in the computer network. RIB 206 describes various routes within the computer network, and the appropriate next hops for each route, i.e., the neighboring routing devices along each of the routes. Routing engine 204 analyzes information stored in RIB 206 and generates forwarding information for forwarding engine 222, stored in Forwarding information base (FIB) 224. FIB 224 may associate, for example, network destinations with specific next hops and corresponding IFCs 226 and physical output ports for output links 230. FIB 224 may be a radix tree programmed into dedicated forwarding chips, a series of tables, a complex database, a link list, a radix tree, a database, a flat file, or various other data structures.

FIB 224 may also include lookup structures. Lookup structures may, given a key, such as an address, provide one or more values. In some examples, the one or more values may be one or more next hops. A next hop may be implemented as microcode, which when executed, performs one or more operations. One or more next hops may be “chained,” such that a set of chained next hops perform a set of operations for respective different next hops when executed. Examples of such operations may include applying one or more services to a packet, dropping a packet, and/or forwarding a packet using an interface and/or interface identified by the one or more next hops.

Session information 235 stores information for identifying sessions. In some examples, session information 235 is in the form of a session table. For example, services information 232 comprises one or more entries that specify a session identifier. In some examples, the session identifier comprises one or more of a source address, source port, destination address, destination port, or protocol associated with a forward flow and/or a reverse flow of the session. As described above, when routing engine 204 receives a packet for a forward packet flow originating from client device 100A and destined for client device 100B of FIG. 1, routing engine 204 determines whether the packet belongs to a new session (e.g., is the “first” packet or “lead” packet of session 40). To determine whether the packet belongs to a new session, routing engine 204 determines whether session information 235 includes an entry corresponding to a source address, source port, destination address, destination port, and protocol of the first packet. If an entry exists, then the session is not a new session. If no entry exists, then the session is new and routing engine 204 generates a session identifier for the session and stores the session identifier in session information 235. Routing engine 204 may thereafter use the session identifier stored in session information 235 for the session to identify subsequent packets as belonging to the same session.

Services information 232 stores information that routing engine 204 may use to identify a service associated with a session. In some examples, services information 232 is in the form of a services table. For example, services information 232 comprises one or more entries that specify a service identifier and one or more of a source address, source port, destination address, destination port, or protocol associated the service. In some examples, routing engine 204 may query services information 232 with one or more of a source address, source port, destination address, destination port, or protocol of a session for a received packet to determine a service associated with a session. For example, routing engine 204 may determine a service identifier based on a correspondence of a source address, source port, destination address, destination port, or protocol in services information 232 to a source address, source port, destination address, destination port, or protocol specified by a session identifier. Routing engine 204 retrieves, based on the service associated with the packet, one or more service policies 234 corresponding to the identified service. The service policies may include, e.g., a path failover policy, a Dynamic Host Configuration Protocol (DHCP) marking policy, a traffic engineering policy, a priority for network traffic associated with the session, etc. Routing engine 204 applies, to the packet, the one or more service policies 234 that correspond to the service associated with the packet.

In accordance with the techniques of the disclosure, router 110 performs session-based routing over L2 customer networks 140 extended over L3 service provider networks 150 of FIG. 1. Router 110 may operate as any of routers 110 of FIG. 1.

With reference to FIG. 1, in the following example, router 110 operates as router 110A. Control unit 202 receives, via IFCs 226, an L2 frame from client device 100A destined for client device 110B. The L2 frame includes an L2 header and a payload. The L2 header specifies a source Media Access Control (MAC) address of client device 100A and a destination MAC address of client device 100B.

In response to receiving the L2 frame, control unit 202 generates an L3 packet comprising an L3 header, a first portion of metadata comprising L2 address information of the first client device and the second client device, a second portion of metadata comprising L3 address information of the first client device and the second client device, and the payload. The L3 header specifies a source Internet Protocol (IP) address and a source port of router 110 and a destination IP address and a destination port of a next-hop router toward client device 100B (e.g., router 110B of FIG. 1). In some examples, control unit 202 identifies the destination IP address and destination port of the next-hop router by retrieving the destination IP address and destination port of the next-hop router from RIB 206.

The first portion of metadata may comprise the source MAC address of client device 100A and the destination MAC address of client device 100B obtained from the L2 frame. In some examples, control unit 202 generates the first portion of metadata by retrieving the source MAC address of client device 100A and the destination MAC address of client device 100B from the received L2 frame.

The second portion of metadata may comprise a source IP address and a source port of client device 100A that correspond to the source MAC address of client device 100A and a destination IP address and a destination port of client device 100B that correspond to the destination MAC address of client device 100B. In some examples, control unit 202 generates the second portion of metadata by querying RIB 206 with the source MAC address of client device 100A and the destination MAC address of client device 100B from the received L2 frame to obtain the source IP address and the source port of client device 100A and the destination IP address and the destination port of client device 100B. Control unit 202 forwards, via IFCs 226 and to the next-hop router (e.g., router 110B), the L3 packet.

In some examples, the second portion of metadata comprises a session identifier. The session identifier is a unique identifier for a session comprising a first packet flow originating from a first client device and destined for a second client device and a second packet flow originating from the second client device and destined for the first client device. Typically, the session identifier comprises a 5-tuple, e.g., the source IP address and the source port of the first client device, the destination IP address and the destination port of the second client device, and a network protocol used by the session. In this example, the session between client device 100A and client device 100B comprises a first L2 packet flow originating from client device 100A and destined for client device 100B and a second L2 packet flow originating from client device 100B and destined for client device 100A, and the protocol is Ethernet.

In this example, the L2 frame is a first L2 frame of a plurality of L2 frames for the session. In response to receiving the first L2 frame, control unit 202 may generate a session identifier for the session between client device 100A and client device 100B and store the session identifier in session information 235 (e.g., so as to store the second portion of metadata of the L3 packet). Control unit 202 may further store the first portion of metadata of the L3 packet so as to store the L2 addressing information associated with the session for the L2 frame. Control unit 202 may generate, based on the first L2 frame, the L3 packet comprising the L3 header, first portion of metadata, and second portion of metadata as described above, and forward the L3 packet toward the next-hop router 110.

For subsequent L2 frames, control unit 202 may determine, based on the source MAC address and destination MAC address of the subsequent L2 frames, that the subsequent L2 frames belong to the same session as the first L2 frame. For example, in response to receiving a second L2 frame for the session, control unit 202 may perform a lookup of session information 235 and determine, based on the source MAC address and destination MAC address, that the second L2 frame belongs to a session having a corresponding entry within session information 235. In some examples, control unit 202 may perform an L3 address lookup of the source MAC address and destination MAC address, and determine whether session information 235 includes an entry for a session corresponding to the L3 address information obtained for the source MAC address and destination MAC address.

In response to determining that the subsequent L2 frames belong to the same session as the first L2 frame, control unit 202 may therefore generate, for the subsequent L2 frames, subsequent L3 packets that include the L3 header but do not include the first portion of metadata or the second portion of metadata, and forward the subsequent L3 packets toward the same next-hop router 110. Subsequent routers 110 may receive the subsequent L3 packets and identify, from the L3 header of the subsequent L3 packets, the session associated with the subsequent L3 packets, and use the stored first portion of metadata to recover the subsequent L2 frames and/or use the stored second portion of metadata to perform session-based routing of the subsequent L3 packets. In this fashion, control unit 202 may only modify the first L3 packet of the plurality of L3 packets generated for the L2 session to include the first portion of metadata and second portion of metadata, thereby avoiding including the first and second portions of metadata within every packet of the plurality of L3 packets generated for the L2 session while still ensuring that each L3 packet of the plurality of L3 packets is forwarded along the same path (e.g., to the same next-hop router 110) and that the L2 frame may be recovered from the L3 packet.

With reference to FIG. 1, in the following example, router 110 operates as router 110I and receives an L3 packet modified as described above from router 110H. For example, control unit 202 receives, via IFCs 226, the L3 packet comprising the L3 header, first portion of metadata, and second portion of metadata. Control unit 202 uses the first portion of metadata comprising the source MAC address of client device 100A and the destination MAC address of client device 100B within the L3 packet to generate, from the L3 packet, an L2 frame comprising the payload and an L2 header specifying the source MAC address of client device 100A and the destination MAC address of client device 100B. Control unit 202 may thereafter forward, via IFCs 226, the recovered L2 frame to client device 100B.

In some examples, the first portion of metadata of the L3 packet may further specify other information that control unit 202 use to recover the L2 frame from the L3 packet and forward the L2 frame to client device 100B. For example, the first portion of metadata may specify a Virtual Local Area Network (VLAN) tag for a VLAN to which client device 100B is assigned. In some examples, the first portion of metadata may specify a Virtual eXtensible Local Area Network (VXLAN) tag for a VXLAN to which client device 100B is assigned. In some examples, the first portion of metadata may specify a VLAN Q-in-Q tag stack comprising a plurality of VLAN tags for multiple stacked VLANs to which client device 100B is assigned. Control unit 202 may include such VLAN, VXLAN, or Q-in-Q tags in the L2 frame or use such tags to forward the L2 frame to client device 100B.

In some examples, the first portion of metadata may specify a bridge identifier for a destination bridge for L2 frame 300A. The bridge identifier may include, for example, a bridge name or bridge group or tag that identifies the destination bridge. Control unit 202 select, based on the bridge identifier, a particular interface (such as one of IFCs 226) for forwarding the L2 frame to client device 100B. A destination router (e.g., router 110I) may use the bridge identifier to determine the appropriate egress interface for the L2 frame.

In this example, the L3 packet comprises the first portion of metadata and second portion of metadata as described above, and is a first L3 packet of a plurality of L3 packets for the session. In response to receiving the first L3 packet, control unit 202 may generate a session identifier for the session between client device 100A and client device 100B and store the session identifier in session information 235 (e.g., so as to store the second portion of metadata of the L3 packet). Control unit 202 may further store the first portion of metadata of the L3 packet so as to store the L2 addressing information associated with the session for the L2 frame. Control unit 202 may generate, based on the first metadata of the first L3 packet, the L2 frame comprising the L2 header as described above, and forward the L2 frame to client device 100B.

Control unit 202 may further receive subsequent L3 packets of the plurality of L3 packets that do not include the first portion of metadata and second portion of metadata. For these subsequent L3 packets, control unit 202 may determine, based on L3 header (e.g., the source IP address and source port of a previous-hop router and the destination IP address and destination port of router 110 (e.g., destination router 110I), the subsequent L3 packets belong to the same session as the first L3 packet. Control unit 202 generates, from the stored first portion of metadata for the first L3 packet comprising the source MAC address and destination MAC address, subsequent L2 frames for the subsequent L3 packets. Therefore, each subsequent L2 frame may likewise comprise an L2 header specifying the source MAC address of client device 100A and destination MAC address of client device 100B. Control unit 202 forwards, via IFCs 226, the subsequent L2 frames to client device 100B. In this fashion, control unit 202 may receive only a first L3 packet that specifies the first portion of metadata and second portion of metadata while subsequent L3 packets do not include such information. Thereby, routers 110 as described herein may avoid including the first and second portions of metadata within every packet of the plurality of L3 packets generated for the L2 session while still ensuring that each L3 packet of the plurality of L3 packets is forwarded along the same path (e.g., to the same next-hop router 110) and that the L2 frame may be recovered from the L3 packet.

FIGS. 3A-3B are block diagrams illustrating a data structure for an L2 frame and a data structure for an L3 packet generated from the L2 frame in accordance with the techniques of the disclosure.

FIG. 3A is a block diagram illustrating a data structure for L2 frame 300A. In some examples, L2 frame 300A comprises an Ethernet frame. L2 frame 300A includes L2 header 340 and data payload 332. L2 header 340 specifies source MAC address 316 indicative of a device originating L2 frame 300A and destination MAC address 318 indicative of a device to which L2 frame 300A is destined.

In some examples where L2 frame 300A is an Ethernet frame, L2 frame 300A may additionally include a preamble, an EtherType, and a frame check sequence (not depicted in FIG. 3A). In some examples, L2 header 340 includes an IEEE 802.1Q VLAN tag that specifies a VLAN to which L2 frame 300A belongs. In some examples, L2 header 340 includes an IEEE 802.1ad Q-in-Q tag that specifies multiple “stacked” VLANs to which L2 frame 300A belongs.

As described above with reference to FIG. 1, in some examples, router 110A receives L2 frame 300A from client device 100A. In this example, source MAC address 316 specifies a MAC address of client device 100A and destination MAC address 318 specifies client device 100B. Router 110A may obtain the source MAC address 316 and destination MAC address 318 from the L2 frame 300A and generate an L3 packet comprising a first portion of metadata including source MAC address 316 and destination MAC address 318, as further described in FIG. 3B below.

FIG. 3B is a block diagram illustrating a data structure for L3 packet 300B generated from L2 frame 300A in accordance with the techniques of the disclosure. L3 packet 300B includes L3 header 302, a first portion of metadata (first metadata 314), a second portion of metadata (second metadata 320), and data payload 332.

L3 header 302 specifies source router IP address 304 indicative of a device originating L3 packet 300B, source port 306 indicative of a port of the originating device from which L3 packet 300B egresses, destination router IP address 308 indicative of a device to which L3 packet 300B is destined, destination port 310 indicative of a port of destination device to which L3 packet 300B is destined, and router IP protocol 312, which specifies a protocol used by L3 packet 300B. In some examples, router IP protocol 312 specifies one of TCP or UDP.

First metadata 314 comprises source MAC address 316 indicative of the device originating L2 frame 300A and destination MAC address 318 indicative of the device to which L2 frame 300A is destined. Source MAC address 316 and destination MAC address 318 of first metadata 314 of L3 packet 300B correspond to source MAC address 316 and destination MAC address 318 of L2 header 340 of L2 frame 300A.

In some examples, first metadata 314 may further specify other information (not expressly depicted in FIG. 3B) that may be used by router 110I to recover L2 frame 300A from L3 packet 300B and forward L2 frame 300A to client device 100B. For example, first metadata 314 may specify a Virtual Local Area Network (VLAN) tag for a VLAN to which client device 100B is assigned. In some examples, first metadata 314 may specify a Virtual eXtensible Local Area Network (VXLAN) tag for a VXLAN to which client device 100B is assigned. In some examples, first metadata 314 may specify a VLAN Q-in-Q tag stack comprising a plurality of VLAN tags for multiple stacked VLANs to which client device 100B is assigned. In some examples, first metadata 314 may specify a bridge identifier for a destination bridge for L2 frame 300A.

Second metadata 320 specifies source client IP address 322, source client port 324, destination client IP address 326, destination client port 328, and client IP protocol 330. Source client IP address 322 and source client port 324 together comprise L3 address information corresponding to source MAC address 316 of the device originating L2 frame 300A. Destination client IP address 326 and destination client port 328 together comprise L3 address information corresponding to destination MAC address 318 of the device to which L2 frame 300A is destined. Client IP protocol 330 specifies a protocol used by source client IP address 322, source client port 324, destination client IP address 326, and destination client port 328. In some examples, client IP protocol 330 specifies one of TCP or UDP.

As described above with reference to FIG. 1, in some examples, router 110A generates L3 packet 300B in response to receiving L2 frame 300A. In this example, source router IP address 304 and source port 306 specify an IP address of router 110A and port used by router 110A to forward L3 packet 300B, respectively. Destination router IP address 308 and destination port 310 specify an IP address and port of router 110B to which L3 packet 300B is destined, respectively.

Furthermore, source MAC address 316 and destination MAC address 318 of first metadata 314 specify a MAC address of client device 100A and specifies client device 100B, respectively. As described above, router 110I of FIG. 1 may use first metadata 314 to recover L2 frame 300A from L3 packet 300B for forwarding to client device 100B.

Additionally, source client IP address 322 and source client port 324 of second metadata 320 specify L3 address information corresponding to the MAC address of client device 100A. Destination client IP address 326 and destination client port 328 of second metadata 320 specify L3 address information corresponding to the MAC address of client device 100B. As described above, routers 110 of FIG. 1 may use second metadata 320 as a session identifier to identify a session associated with L2 frame 300A and/or L3 packet 300B so as to perform session-based routing of L2 frame 300A and/or L3 packet 300B.

FIG. 4 is a flowchart illustrating an example operation in accordance with the techniques of the disclosure. FIG. 4 is described with respect to FIG. 1 for convenience.

Router 110A receives, from client device 100A, an L2 frame destined for client device 100B (402). An L2 network, such as customer network 140A, connects client device 100A to router 110A. The L2 frame comprises a payload and an L2 header specifying a source MAC address of client device 100A and a destination MAC address of client device 100B.

In response to receiving the L2 frame, router 110A generates an L3 packet comprising an L3 header, a first portion of metadata comprising L2 addresses of the first client device and the second client device, and a second portion of metadata comprising L3 addresses of the first client device and the second client device, and the payload (404). The L3 header specifies a source IP address and a source port of router 110A and a destination IP address and destination port of router 110B. The first portion of metadata comprises the source MAC address of client device 100A and the destination MAC address of client device 100B. The second portion of metadata comprises a source IP address and a source port of client device 100A that correspond to the source MAC address of client device 100A and a destination IP address and a destination port of client device 100B that correspond to the destination MAC address of client device 100B.

Router 110A forwards the L3 packet toward router 110I via L3 service provider networks 150 (406). For example, router 110A forwards the L3 packet to router 110B. As described above, router 110B may replace the L3 header of the L3 packet with a new L3 header that specifies a source IP address and a source port of router 110B and a destination IP address and destination port of router 110C before forwarding the L3 packet to router 110C. Router 110C, in turn, may replace the L3 header of the L3 packet with yet another new L3 header that specifies a source IP address and a source port of router 110C and a destination IP address and destination port of router 110D before forwarding the L3 packet to router 110D.

Eventually, router 110I receives the L3 packet from, e.g., router 110H (408). In response to receiving the L3 packet, router 110I generates the L2 frame from the first portion of metadata of the L3 packet (410). The recovered L2 frame comprises the payload and the L2 header specifying the source MAC address of client device 100A and the destination MAC address of client device 100B. Router 110I forwards, to client device 100B, the recovered L2 frame destined for client device 100B via another L2 network, such as customer network 140B, which connects router 110I to client device 100B (412).

The techniques described in this disclosure may be implemented, at least in part, in hardware, software, firmware or any combination thereof. For example, various aspects of the described techniques may be implemented within one or more processors, including one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or any other equivalent integrated or discrete logic circuitry, as well as any combinations of such components. The term “processor” or “processing circuitry” may generally refer to any of the foregoing logic circuitry, alone or in combination with other logic circuitry, or any other equivalent circuitry. A control unit comprising hardware may also perform one or more of the techniques of this disclosure.

Such hardware, software, and firmware may be implemented within the same device or within separate devices to support the various operations and functions described in this disclosure. In addition, any of the described units, modules or components may be implemented together or separately as discrete but interoperable logic devices. Depiction of different features as modules or units is intended to highlight different functional aspects and does not necessarily imply that such modules or units must be realized by separate hardware or software components. Rather, functionality associated with one or more modules or units may be performed by separate hardware or software components, or integrated within common or separate hardware or software components.

The techniques described in this disclosure may also be embodied or encoded in a computer-readable medium, such as a computer-readable storage medium, containing instructions. Instructions embedded or encoded in a computer-readable storage medium may cause a programmable processor, or other processor, to perform the method, e.g., when the instructions are executed. Computer readable storage media may include random access memory (RAM), read only memory (ROM), programmable read only memory (PROM), erasable programmable read only memory (EPROM), electronically erasable programmable read only memory (EEPROM), flash memory, a hard disk, a CD-ROM, a floppy disk, a cassette, magnetic media, optical media, or other computer readable media.

Various examples have been described. These and other examples are within the scope of the following claims. 

What is claimed is:
 1. A method comprising: receiving, by a first router and from a first client device connected to the first router via a first Open Systems Interconnection (OSI) Model Layer-2 (L2) network, an L2 frame destined for a second client device, the L2 frame comprising an L2 header specifying a source Media Access Control (MAC) address of the first client device and a destination MAC address of the second client device, wherein the first router is connected to a second router via an OSI Model Layer-3 (L3) network, and wherein the second router is connected to the second client device via a second L2 network; generating, by the first router and in response to receiving the L2 frame, an L3 packet comprising: an L3 header specifying a source Internet Protocol (IP) address and a source port of the first router and a destination IP address and a destination port of the second router; and a first portion of metadata comprising the source MAC address of the first client device and the destination MAC address of the second client device; and forwarding, by the first router, via the L3 network, and to the second router, the L3 packet.
 2. The method of claim 1, wherein the first portion of metadata further comprises a Virtual Local Area Network (VLAN) tag for a VLAN to which the first client device is assigned.
 3. The method of claim 1, wherein the first portion of metadata further comprises a Virtual eXtensible Local Area Network (VXLAN) tag for a VXLAN to which the first client device is assigned.
 4. The method of claim 1, wherein the first portion of metadata further comprises a bridge identifier for a destination bridge.
 5. The method of claim 1, wherein the first portion of metadata further comprises a Virtual Local Area Network (VLAN) Q-in-Q tag stack comprising a plurality of VLAN tags.
 6. The method of claim 1, wherein the L3 packet comprises at least one of a Transmission Control Protocol (TCP) packet or a User Datagram Protocol (UDP) packet, and wherein the L2 frame comprises an Ethernet frame.
 7. The method of claim 1, wherein the L3 packet further comprises a second portion of metadata comprising: a source IP address and a source port of the first client device that correspond to the source MAC address of the first client device; and a destination IP address and a destination port of the second client device that correspond to the destination MAC address of the second client device.
 8. The method of claim 7, wherein the second portion of metadata comprises a session identifier for a session comprising a first packet flow originating from the first client device and destined for the second client device and a second packet flow originating from the second client device and destined for the first client device, wherein at least one of the first packet flow or the second packet flow comprise the L2 frame, and wherein the session identifier comprises the source IP address and the source port of the first client device, the destination IP address and the destination port of the second client device, and a network protocol for the L2 frame.
 9. The method of claim 8, further comprising: storing, by the first router, the session identifier for the session; receiving, by the first router and from the first client device via the first L2 network, one or more subsequent L2 frames destined for the second client device, the one or more subsequent L2 frames specifying the source MAC address of the first client device and the destination MAC address of the second client device; determining, by the first router, in response to receiving the one or more subsequent L2 frames, and based on the session identifier for the session, that the one or more subsequent L2 frames belong to the at least one of the first packet flow or the second packet flow; generating, by the first router, one or more subsequent L3 packets, wherein the one or more subsequent L3 packets do not include the first portion of metadata or the second portion of metadata; and forwarding, by the first router, via the L3 network, and to the second router, the one or more subsequent L3 packets.
 10. A first router comprising processing circuitry configured to: receive, from a first client device connected to the first router via a first Open Systems Interconnection (OSI) Model Layer-2 (L2) network, an L2 frame destined for a second client device, the L2 frame comprising an L2 header specifying a source Media Access Control (MAC) address of the first client device and a destination MAC address of the second client device, wherein the first router is connected to a second router via an OSI Model Layer-3 (L3) network, and wherein the second router is connected to the second client device via a second L2 network; generate, in response to receiving the L2 frame, an L3 packet comprising: an L3 header specifying a source Internet Protocol (IP) address and a source port of the first router and a destination IP address and a destination port of the second router; and a first portion of metadata comprising the source MAC address of the first client device and the destination MAC address of the second client device; forward, via the L3 network, and to the second router, the L3 packet.
 11. The first router of claim 10, wherein the L3 packet comprises at least one of a Transmission Control Protocol (TCP) packet or a User Datagram Protocol (UDP) packet, and wherein the L2 frame comprises an Ethernet frame.
 12. The first router of claim 10, wherein the L3 packet further comprises a second portion of metadata comprising: a source IP address and a source port of the first client device that correspond to the source MAC address of the first client device; and a destination IP address and a destination port of the second client device that correspond to the destination MAC address of the second client device.
 13. The first router of claim 12, wherein the second portion of metadata comprises a session identifier for a session comprising a first packet flow originating from the first client device and destined for the second client device and a second packet flow originating from the second client device and destined for the first client device, wherein at least one of the first packet flow or the second packet flow comprise the L2 frame, and wherein the session identifier comprises the source IP address and the source port of the first client device, the destination IP address and the destination port of the second client device, and a network protocol for the L2 frame.
 14. The first router of claim 13, further comprising a memory configured to store the session identifier for the session, wherein the processing circuitry is further configured to: receive, from the first client device via the first L2 network, one or more subsequent L2 frames destined for the second client device, the one or more subsequent L2 frames specifying the source MAC address of the first client device and the destination MAC address of the second client device; determine, in response to receiving the one or more subsequent L2 frames and based on the session identifier for the session, that the one or more subsequent L2 frames belong to the at least one of the first packet flow or the second packet flow; generate, one or more subsequent L3 packets, wherein the one or more subsequent L3 packets do not include the first portion of metadata or the second portion of metadata; and forward, via the L3 network and to the second router, the one or more subsequent L3 packets.
 15. A method comprising: receiving, by a second router and from a first router connected to the second router via an Open Systems Interconnection (OSI) Model Layer-3 (L3) network, an L3 packet, wherein the first router is connected to a first client device via a first OSI Model Layer-2 (L2) network and the second router is connected to a second client device via a second L2 network, and wherein the L3 packet comprises: an L3 header specifying a source Internet Protocol (IP) address and a source port of the first router and a destination IP address and a destination port of the second router; and a first portion of metadata comprising a source Media Access Control (MAC) address of the first client device and a destination MAC address of the second client device; generating, by the second router and based on the first portion of metadata of the L3 packet, an L2 frame comprising an L2 header specifying the source MAC address of the first client device and the destination MAC address of the second client device; and forwarding, by the second router, via the second L2 network, and to the second client device, the L2 frame.
 16. The method of claim 15, wherein the first portion of metadata further comprises a Virtual Local Area Network (VLAN) tag for a VLAN to which the first client device is assigned.
 17. The method of claim 15, wherein the first portion of metadata further comprises a Virtual eXtensible Local Area Network (VXLAN) tag for a VXLAN to which the first client device is assigned.
 18. The method of claim 15, wherein the first portion of metadata further comprises a bridge identifier for a destination bridge, wherein the method further comprises selecting, by the second router and based on the bridge identifier, an interface of a plurality of interfaces of the second router, and wherein forwarding, by the second router, the L2 frame comprises forwarding, by the second router and via the selected interface of the plurality of interfaces of the second router, the L2 frame.
 19. The method of claim 15, wherein the L3 packet comprises at least one of a Transmission Control Protocol (TCP) packet or a User Datagram Protocol (UDP) packet, and wherein the L2 frame comprises an Ethernet frame.
 20. The method of claim 15, wherein the L3 packet further comprises a second portion of metadata comprising a session identifier for a session comprising a first packet flow originating from the first client device and destined for the second client device and a second packet flow originating from the second client device and destined for the first client device, wherein at least one of the first packet flow or the second packet flow comprise the L2 frame, wherein the session identifier comprises a source IP address and a source port of the first client device that correspond to the source MAC address of the first client device, a destination IP address and a destination port of the second client device that correspond to the destination MAC address of the second client device, and a network protocol for the L2 frame, wherein the method further comprises: storing, by the second router, the session identifier for the session, receiving, by the second router, one or more subsequent L3 packets, wherein the one or more subsequent L3 packets do not include the first portion of metadata or the second portion of metadata; determining, by the second router and based on the session identifier for the session, that the one or more subsequent L3 frames belong to the at least one of the first packet flow or the second packet flow, generating, by the second router and based on the first portion of metadata of the L3 packet, one or more subsequent L2 frames for the one or more subsequent L3 frames, the one or more subsequent L2 frames comprising the L2 header specifying the source MAC address of the first client device and the destination MAC address of the second client device; and forwarding, by the second router, via the second L2 network, and to the second client device, the one or more subsequent L2 frames. 